﻿using UnityEngine;
using System.Collections;

public class goal : MonoBehaviour {
	public bool goalReached = false;
	public Texture2D goalVacant;
	public Texture2D goalOccopied;
	public GameObject SuccessSplashScreen;


	void OnTriggerEnter(Collider other) {
		if(goalReached == false && other.tag == "Player"){
			goalReached = true;
			transform.gameObject.renderer.material.mainTexture = goalOccopied;
			Debug.Log("GOAL!");

			SuccessSplashScreen.SetActive(true);

			}
		}

}
